<template>
  <div class="app">
    <iframe :src="fileUrl" width="70%" height="70%" frameborder="0" allowfullscreen></iframe>
    <div class="return" @click="back"></div>
  </div>
</template>

<script>
export default {
  name: 'textview',
  data() {
    return {
      sceneType: null,
      personnelType: null,
      fileUrl: ''
    };
  },
  methods: {
    back() {
      this.$router.replace({
        name: 'frontMaterial',
        query: { personnelType: this.personnelType }
      });
    }
  },
  mounted() {
    this.$message('正在加载文档，请稍后...');
    const previewUrl = this.$route.query.previewUrl;
    this.fileUrl = previewUrl;
    const personnelType = this.$route.query.personnelType;
    this.personnelType = personnelType;
  }
};
</script>

<style type="scss" scoped>
.app {
  background-image: url('~@/assets/img/bg.png');
  background-size: cover;
  display: flex;
  justify-content: center; /* 水平居中 */
  align-items: center; /* 垂直居中 */
  height: 100vh; /* 让父容器充满整个视口高度 */
}
.return {
  width: 252px;
  height: 66px;
  background-image: url('~@/assets/img/return.png');
  background-size: cover;
  position: absolute;
  bottom: 5%;
  cursor: pointer;
}
</style>
